﻿using System;
using System.Collections.Generic;
using System.Configuration;
using System.Data.SqlClient;
using System.Linq;
using System.Web;
using System.Web.UI;
using System.Web.UI.WebControls;
using DevExpress.Web.ASPxEditors;
using DevExpress.Web.ASPxGridView;

namespace UdrinkWater_Project.Officer
{
    public partial class Confirm_Sender : System.Web.UI.Page
    {
        //string Connection = ConfigurationManager.ConnectionStrings["DB_Udrink"].ConnectionString;
        protected void Page_Load(object sender, EventArgs e)
        {
            GV_SenderCon.DataBind();
            for (int i = 0; i < GV_SenderCon.VisibleRowCount; i++)
            {
                LinkButton Detial = (LinkButton)GV_SenderCon.FindRowCellTemplateControl(i, (GridViewDataColumn)GV_SenderCon.Columns["colMyColumn"], "Link_DetialUnpaid");
                object Status = GV_SenderCon.GetRowValues(i, "Status_Unpaid"); 
                if (Convert.ToInt32(Status)==2)
                {
                    Detial.Visible = true;
                }
                else
                {
                    Detial.Visible = false;
                }
            }
        }

        protected void GV_SenderCon_RowCommand(object sender, ASPxGridViewRowCommandEventArgs e)
        {
            if (e.CommandArgs.CommandName =="Cmd_Detial")
            {
                int Index = GV_SenderCon.FindVisibleIndexByKeyValue(e.KeyValue);
                object Order_ID = GV_SenderCon.GetRowValues(Index, "Order_Date");
                string Order_Date = Convert.ToDateTime(Order_ID).ToString("yyyy-MM-dd HH:mm:ss.fff", new System.Globalization.CultureInfo("en-US"));
                Session["RefUnpaid"] = Order_Date;
                Response.Redirect("Referent_Sender.aspx");
            }
        }


       

       
    }
}